package edu.lsnu.equipment_management_system.mapper.update;

import edu.lsnu.equipment_management_system.pojo.vo.sql_conditions.UserNoAndEquipmentNoVo;
import org.apache.ibatis.annotations.Update;

/**
 * @author mzy
 * @Description 设备的使用者改变
 * @date 2018/11/20
 */
public interface UpdateEquipmentUseRecordTableEndDateMapper {
    /**
     * @Description 为上一条使用记录加上结束时间
     * @author mzy
     * @time 2018-11-22
     * @see
     * @return   int
     * @params  []
     */
    @Update("update JBXX_SBSY set JBXX_SBSY.SYRQ2 = GETDATE()\n" +
            "where JBXX_SBSY.ZGH = #{userNo} and JBXX_SBSY.SBBH = #{equipmentNo} and \n" +
            "JBXX_SBSY.SYRQ1 is not null and \n" +
            "JBXX_SBSY.SYRQ2 is null") // 50830025 / 20020152
    int updateEndTimeToPreviousEquipmentUseRecord(UserNoAndEquipmentNoVo userNoAndEquipmentNoVo);

}
